/**
 * 
 */
package den.Study_3;

/**
 * @author Administrator
 *
 */
public class LinkList {
	private List head=null;
	public List head(){
		return head;
	}
	public boolean hasNext(List node){
		if(node.next!=null){
			return true;
		}
		return false;
	}
	public void addNodeAtLast(int value){
		List temp=new List(value);
		if(head==null){
			head=temp;
		}
		else{
			List tmp=head;
			while(hasNext(tmp)){
				tmp=tmp.next;
			}
			tmp.next=temp;
		}
	}
	public List getNode(int index){
		List temp=null;
		for(int i=0;i<index;i++){
			temp=head();
		}
		if(hasNext(temp)){
			return temp;
		}
		return null;
		
	}

}
